package db;

import android.net.Uri;
import android.provider.BaseColumns;

public class XoneDBTables {
	public static final String AUTHORITY = XoneDBProvider.AUTHORITY;
	public static final String[] TableNames = new String[]{
		AccountTable.TABLE_NAME,
		DiscussTipTable.TABLE_NAME,
		AppInfoTable.TABLE_NAME,
		MsgCenterTable.TABLE_NAME,
		DraftTable.TABLE_NAME
	};
	
	public static interface AccountTable {
		public static final String TABLE_NAME = "account";
		
		public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);
		
		/**===================数据库字段==================*/
		/**帐号*/
    	public static final String C_USER_ACCOUNT = "user_account";
    	/**密码*/
    	public static final String C_USER_PASSWORD = "user_pwd";
    	/**id*/
    	public static final String C_USER_ID = "user_id";
    	/**nickname*/
    	public static final String C_USER_NICKNAME = "user_nickname";
    	/**avatar*/
        public static final String C_USER_AVATAR = "user_avatar";
    	/**type 定义见XoneProtocolConsts.ACCOUNT_TYPE*/
    	public static final String C_USER_TYPE = "user_type";
    	/**是否最近一次登录 1为登录，其他为未登录*/
    	public static final String C_LAST_LOGIN = "last_login";
    	/**更新时间*/
        public static final String C_UPDATE_TIME = "update_time"; 
        /**当userType为官方用户时：1，游戏类；2，综合类。当userType为普通用户时：5，普通，6，加V*/
        public static final String C_USER_ATTR = "user_attr"; 
	}

	public static interface DiscussTipTable {
	    public static final String TABLE_NAME = "disscuss";
	    public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);
	    
	    /**===================数据库字段==================*/
	    // 协议类别，分别有用户，资讯源，热门话题和订阅主题四种
        public static final String C_TYPE = "type";
        // 请求参数类别，只有在用户和资讯源这两个协议中用到
        public static final String C_SUBTYPE = "subtype";
        // 时间戳
        public static final String C_TIME = "time";
        // 第一个中文子的拼音，用在C_TIP_TYPE类型为用户和资讯源时，建立首字母索引
        public static final String C_PINYIN = "pinyin";
        // 用来可以进行模糊匹配的内容
        public static final String C_CONTENT = "content";
        // 原始json内容
        public static final String C_JSON = "json";
	}
	
	/********************************************************************
     * 资讯表
     *******************************************************************/
	public static interface AppInfoTable {
        public static final String TABLE_NAME = "appinfo";
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);
        
        /**===================数据库字段==================*/
        // 帐号
        public static final String C_ACCOUNT = "account";
        // 按资讯分组
        public static final String C_INFOGROUP = "infogroup";
        // 排序
        public static final String C_SORTTYPE = "sorttype";
        // 帐号
        public static final String C_INFOID = "infoid";
        // 时间戳
        public static final String C_TIME = "time";
        // 原始json内容
        public static final String C_JSON = "json";
    }
	
	/********************************************************************
     * 消息中心表
     *******************************************************************/
    public static final class MsgCenterTable implements BaseColumns{  
        //String
        public static final String C_ACCOUNT        = "account";    //账户名
        //String
        public static final String C_MSGID          = "msgid";      // push服务器产生的id
        //string
        public static final String C_PUSH           = "push";// push完整内容, json
        //string
        public static final String C_MESSAGE        = "message";    // 根据ID获取的消息详细内容
        //int
        public static final String C_TYPE           = "type";    // push消息类型
        //int
        public static final String C_READ           = "read";   // 0未读, 1已读
        //String
        public static final String C_UPDATED        = "updated";    // 更新时间
        //string
        public static final String C_RESERVE        = "reserve";    // 保留
        
        
        
        public static final String TABLE_NAME       = "msgcenter";      // 表名
        public static final Uri CONTENT_URI   = Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);
    }
    
    /********************************************************************
     * 草稿表
     *******************************************************************/
    public static interface DraftTable {
        public static final String TABLE_NAME = "draft";
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);
        
        /**===================数据库字段==================*/
        // 帐号
        public static final String C_ACCOUNT = "account";
        // 讨论内容
        public static final String C_CONTENT = "content";
        // 语音路径
        public static final String C_RECORDER = "record";
        // 语音时长
        public static final String C_DURATION = "duration";
        // 图片路径
        public static final String C_IMAGE = "image";
        // 滤镜类型
        public static final String C_FILTER = "filter";
        // 时间戳
        public static final String C_TIME = "time";
    }
}
